From 7ef5858f8de8bf2fa8e0e0dad0e860f81306a368 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 13 Nov 2017 12:48:57 +0100 Subject: [PATCH] GtkWindow: Fix the down-scaling in icon_from_list() Must use floating-point division to get the correct scale factors. cairo_set_source_surface() must be called after cairo_scale(). https://bugzilla.gnome.org/show_bug.cgi?id=790287 --- gtk/gtkwindow.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 01bc34ec2c..0ffd006388 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -4544,10 +4544,10 @@ icon_from_list (GList *list, target = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, size, size); cr = cairo_create (target); - cairo_set_source_surface (cr, source , 0, 0); cairo_scale (cr, - size / gdk_texture_get_width (texture), - size / gdk_texture_get_height (texture)); + (double) size / gdk_texture_get_width (texture), + (double) size / gdk_texture_get_height (texture)); + cairo_set_source_surface (cr, source, 0, 0); cairo_paint (cr); cairo_destroy (cr); cairo_surface_destroy (source); -- 2.30.2